package com.shanzmoo.db.personnel.entity.vo;

import com.shanzmoo.db.personnel.entity.MemberInfoEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 客户筛选对象
 *
 * @author Gzhao
 * @date 2020/12/14
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@ApiModel("客户筛选对象")
public class MemberSelectVo implements Serializable {

    private static final long serialVersionUID = 1758L;

    @ApiModelProperty("客户ID")
    private Integer id;

    @ApiModelProperty("客户名称")
    private String name;

    @ApiModelProperty("结算方式（是否月结）：0-否，1-是")
    private Boolean monthly;

    @ApiModelProperty("折扣")
    private BigDecimal discount;

    public static MemberSelectVo create(MemberInfoEntity member) {
        return MemberSelectVo.builder()
                .id(member.getId())
                .name(member.getName())
                .monthly(member.getMonthly())
                .discount(member.getDiscount())
                .build();
    }
}
